#!/bin/bash
#mkdir -p speaker-effects
#mkdir -p speaker-effects/data
#training data
dir=speaker-sensitivity/data
data=data/train_si284
mkdir -p $dir
for x in 4at 4au 4av 4af 4ag 4ah 4ai 4aw 4ax 4ay; do
  mkdir $dir/$x
  grep ^$x $data/wav.scp > $dir/$x/wav.scp 
  grep ^$x $data/spk2utt > $dir/$x/spk2utt
  grep ^$x $data/utt2spk > $dir/$x/utt2spk
  grep ^$x $data/text    > $dir/$x/text
  grep ^$x $data/spk2gender > $dir/$x/spk2gender
  utils/fix_data_dir.sh $dir/$x
done


#Dev data
data=data/test_dev93
mkdir -p $dir
for x in 4k0 4k1 4k2 4k3 4k4 4k6 4k7 4k8 4k9 4ka; do
  mkdir $dir/$x
  grep $x $data/wav.scp > $dir/$x/wav.scp
  grep $x $data/spk2utt > $dir/$x/spk2utt
  grep $x $data/utt2spk > $dir/$x/utt2spk
  grep $x $data/text    > $dir/$x/text
  grep $x $data/spk2gender > $dir/$x/spk2gender
  utils/fix_data_dir.sh $dir/$x
done


data=data/test_eval92
mkdir -p $dir
for x in 440 441 442 443 444 445 446 447; do
  mkdir $dir/$x
  grep $x $data/wav.scp > $dir/$x/wav.scp
  grep $x $data/spk2utt > $dir/$x/spk2utt
  grep $x $data/utt2spk > $dir/$x/utt2spk
  grep $x $data/text    > $dir/$x/text
  grep $x $data/spk2gender > $dir/$x/spk2gender
  utils/fix_data_dir.sh $dir/$x
done
